class CreateDevice < ActiveRecord::Migration
  def self.up
    create_table :devices do |t|
      t.string   :name
      t.integer  :fd
      t.decimal  :cmv,          :precision => 8, :scale => 2, :default => 0.0
      t.text     :desc
      t.integer  :timescale
      t.integer  :timefactor
      t.integer  :mr
      t.integer  :mat_id
      t.integer  :size_id
      t.string   :fuel
      t.datetime :created_at
      t.datetime :updated_at
      t.decimal  :cost,          :precision => 8, :scale => 2, :default => 0.0
      t.decimal  :remainingcost, :precision => 8, :scale => 2, :default => 0.0
      t.decimal  :actualcost,    :precision => 8, :scale => 2, :default => 0.0
    end
  end

  def self.down
    drop_table :devices
  end
end
